package org.sardine.beans.test_mock;

import java.util.HashMap;
import java.util.Map;

import org.sardine.beans.support.ElmBeanDefinition;
import org.sardine.beans.support.ElmBeanDefinitionRegistry;

public class MockElmBeanDefinitionRegistry implements ElmBeanDefinitionRegistry{
	
	private final Map<String,ElmBeanDefinition> beanDefinitions = new HashMap<String,ElmBeanDefinition>();

	public void registerElmBeanDefinition(String id, ElmBeanDefinition beanDefinition) {
		this.beanDefinitions.put(id, beanDefinition);
	}

	public void removeElmBeanDefinition(String id) {
		this.beanDefinitions.remove(id);
	}

	public ElmBeanDefinition getElmBeanDefinition(String id) {
		return this.beanDefinitions.get(id);
	}

	public boolean containsElmBeanDefinition(String id) {
		return this.beanDefinitions.containsKey(id);
	}

	public int getElmBeanDefinitionCount() {
		return this.beanDefinitions.size();
	}

}
